pathbar: Reimplement using GtkBox
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 24 Nov 2022 19:17:30 +0000 (16:17 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 13 Dec 2022 17:45:15 +0000 (14:45 -0300)
commit8cf981024083aa6f5a6bc1544d5d2fc2a20259c4
tree2438d036a017b69ab288ff64d91ee446a087440d
parentf0a76f2ca87d6a5ae79d9c679e3c54a56c8d3cfe
pathbar: Reimplement using GtkBox

The path bar does a lot of manual management of buttons, mostly to
be able to show navigation arrows when there's not enough space to
show the full path.

Since the GTK4 migration, this is slightly broken in some cases, due
to the 'need_sliders' variable being always set to TRUE. Furthermore,
after the introduction of the Recent button as a special cased fake
root, the allocation of the buttons is generating warnings.

Reimplement the path bar as a GtkBox, inside a GtkScrolledWindow.
This mimics what Nautilus does, and allows us to make navigation more
predictable, and remove most of the complexity from GtkPathBar. It
also prevents it from generating allocation warnings.

The path bar itself now doesn't override GtkWidget.measure nor
GtkWidget.allocate; instead, it delegates layout to the GtkBinLayout
layout manager.

CSS is adjusted to account for the changed hierarchy of buttons.
gtk/gtkpathbar.c
gtk/theme/Default/_common.scss